#include "IntModel.h"

void InterruptionModel::handleInt()
{
	m_IntLock.lock();
	int i = 0;
	
	while (m_IntFlag.any()) {
		if (m_IntFlag.test(i) && m_Handlers.at(i)) {
			(*m_Handlers.at(i))();
		}
		m_IntFlag.reset(i);
		i = (++ i) % INT_COUNT;
	}

	m_HasInt = false;
	m_IntLock.unLock();
}